﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Trnx.Creator
{
    class Program
    {
        static void Main(string[] args)
        {
            Random rnd = new Random();
            PhotoCompetetionDBEntities context = new PhotoCompetetionDBEntities();
            for (int i = 0; i < 2; i++)
            {
                Transactions trnx = new Transactions();
                trnx.UserId = rnd.Next(111111111, 999999999).ToString();
                trnx.PhotoId = 206;
                trnx.Liked = true;
                trnx.ApprovalDate = DateTime.Today;
            A: Transactions obj = context.Transactions.Find(rnd.Next(52, 7342));
                if (obj == null)
                    goto A;
                else
                    trnx.IPAddress = obj.IPAddress;

                context.Transactions.Add(trnx);
                Console.WriteLine(context.SaveChanges() + " " + trnx.UserId + " " +trnx.PhotoId+ "eklendi");
            }
            Console.ReadLine();

        }
    }
}
